package cn.rongdao.jrkabao.ui.main.mainfragment.cashadvance.viewholder;

import android.support.v7.widget.RecyclerView;
import android.view.View;

import cn.rongdao.jrkabao.R;
import cn.rongdao.jrkabao.ui.main.mainfragment.cashadvance.adapter.CashAdvanceAdapter;
import cn.rongdao.jrkabao.ui.main.mainfragment.cashadvance.ui.BannerComponent;
import cn.rongdao.jrkabao.ui.main.mainfragment.cashadvance.ui.CashHeadComponent;
import cn.rongdao.jrkabao.ui.main.mainfragment.cashadvance.ui.HomeIdentityUIComponent;
import cn.rongdao.jrkabao.ui.main.mainfragment.cashadvance.ui.LoanAndAdvComponent;
import cn.rongdao.jrkabao.ui.main.mainfragment.cashadvance.ui.NavigationComponent;

/**
 * Created by WANG on 17/12/18
 */

public class CashAdvanceViewHolder extends RecyclerView.ViewHolder {
    public CashHeadComponent cashCompoment;
    public NavigationComponent navigationCompoment;
    public BannerComponent bannerCompoment;
    public LoanAndAdvComponent itemListComponent;
    public HomeIdentityUIComponent homeIdentityUIComponent;

    public CashAdvanceViewHolder(View itemView, int ViewType) {
        super(itemView);
        switch (ViewType) {
            case CashAdvanceAdapter.VIEWTYPE_HEAD:
                if(cashCompoment == null){
                    cashCompoment = itemView.findViewById(R.id.cashcomponent);
                }
                break;
            case CashAdvanceAdapter.VIEWTYPE_NAVIGATION:
                if(navigationCompoment == null){
                    navigationCompoment = itemView.findViewById(R.id.nativationcomponent);
                }
                break;
            case CashAdvanceAdapter.VIEWTYPE_BANNER:
                if(bannerCompoment == null){
                    bannerCompoment = itemView.findViewById(R.id.bannerComponent);
                }
                break;
            case CashAdvanceAdapter.VIEWTYPE_IDENTITY:
                if(homeIdentityUIComponent == null){
                    homeIdentityUIComponent =itemView.findViewById(R.id.home_identity_component);
                }
                break;
            case CashAdvanceAdapter.VIEWTYPE_LOAN:
                if(itemListComponent == null){
                    itemListComponent = itemView.findViewById(R.id.home_itemList);
                }
                break;
            case CashAdvanceAdapter.VIEWTYPE_ADV:
                if(itemListComponent == null){
                    itemListComponent = itemView.findViewById(R.id.home_itemList);
                }
                break;

        }
    }
}
